package com.kk.springboot_001.controller;


import org.springframework.security.core.Authentication;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;

@Controller
public class LoginController {
    @GetMapping("/login")
    public String showLoginPage() {
        return "login";
    }

    @GetMapping("/success")
    public String showSuccessPage(Authentication authentication, Model model) {
        String userName = authentication.getName();
        model.addAttribute("userName", userName);
        return "success";
    }
}
